package config

// DataSource 数据源配置(支持多种数据库类型)
type DataSource struct {
	DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"`
	Mysql  Mysql  `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
	Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
}

// Mysql 数据库配置
type Mysql struct {
	Host     string `mapstructure:"host" json:"host" yaml:"host"`
	Port     string `mapstructure:"port" json:"port" yaml:"port"`
	Database string `mapstructure:"database" json:"database" yaml:"database"`
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
}

// Sqlite 数据库配置
type Sqlite struct {
	Path string `mapstructure:"path" json:"path" yaml:"path"`
}
